cargo.git
11 years agoDon't leave behind corrupt directories
Alex Crichton [Mon, 27 Oct 2014 19:44:50 +0000 (12:44 -0700)]
Don't leave behind corrupt directories

Ensure that a system `rm -rf target` will continue to work across test runs.

11 years agoauto merge of #718 : alexcrichton/cargo/issue-715, r=brson
bors [Mon, 27 Oct 2014 17:14:56 +0000 (17:14 +0000)]
auto merge of #718 : alexcrichton/cargo/issue-715, r=brson

We won't make much progress reporting the error back up the chain, so we may as
well carry on!

Closes #715

11 years agoauto merge of #761 : kali/cargo/patch-1, r=alexcrichton
bors [Mon, 27 Oct 2014 16:00:18 +0000 (16:00 +0000)]
auto merge of #761 : kali/cargo/patch-1, r=alexcrichton

11 years agoTwo typos
Mathieu Poumeyrol [Mon, 27 Oct 2014 00:42:15 +0000 (01:42 +0100)]
Two typos

11 years agoauto merge of #755 : pwoolcoc/cargo/fix-664, r=alexcrichton
bors [Fri, 24 Oct 2014 19:03:56 +0000 (19:03 +0000)]
auto merge of #755 : pwoolcoc/cargo/fix-664, r=alexcrichton

11 years agocargo new: Don't create a git repo in subdirectory
Paul Woolcock [Thu, 23 Oct 2014 12:30:36 +0000 (08:30 -0400)]
cargo new: Don't create a git repo in subdirectory

Running `cargo new` to create a subpackage shouldn't create another
git repository if one exists in a parent directory.

Closes #664

11 years agoauto merge of #750 : alexcrichton/cargo/no-more-travis-32, r=alexcrichton
bors [Fri, 24 Oct 2014 15:59:59 +0000 (15:59 +0000)]
auto merge of #750 : alexcrichton/cargo/no-more-travis-32, r=alexcrichton

This has been broken for quite awhile now on 32-bit linux due to what looks like
libcurl going awry. This can be reactivated later, but consistently green travis
builds are more important right now.

Additionally, we already have coverage on the buildbots for 32-bit flavors of
architectures.

11 years agoauto merge of #754 : blaenk/cargo/whitespace, r=alexcrichton
bors [Fri, 24 Oct 2014 15:15:00 +0000 (15:15 +0000)]
auto merge of #754 : blaenk/cargo/whitespace, r=alexcrichton

I missed this when I changed the values to the defaults! It simply lines up the comment with the one above it.

11 years agoline up the comments
Jorge Israel Peña [Fri, 24 Oct 2014 06:27:28 +0000 (23:27 -0700)]
line up the comments

11 years agoauto merge of #752 : alexcrichton/cargo/typos, r=alexcrichton
bors [Thu, 23 Oct 2014 20:59:57 +0000 (20:59 +0000)]
auto merge of #752 : alexcrichton/cargo/typos, r=alexcrichton

11 years agoFix some copy-paste errors in CLI help
Alex Crichton [Thu, 23 Oct 2014 20:57:11 +0000 (13:57 -0700)]
Fix some copy-paste errors in CLI help

11 years agoStop testing 32-bit on travis
Alex Crichton [Thu, 23 Oct 2014 20:24:16 +0000 (13:24 -0700)]
Stop testing 32-bit on travis

This has been broken for quite awhile now on 32-bit linux due to what looks like
libcurl going awry. This can be reactivated later, but consistently green travis
builds are more important right now.

Additionally, we already have coverage on the buildbots for 32-bit flavors of
architectures.

11 years agoauto merge of #747 : kballard/cargo/manifest_typo_fix, r=alexcrichton
bors [Thu, 23 Oct 2014 05:14:55 +0000 (05:14 +0000)]
auto merge of #747 : kballard/cargo/manifest_typo_fix, r=alexcrichton

11 years agoFix typo in src/doc/manifest.md
Kevin Ballard [Thu, 23 Oct 2014 05:02:15 +0000 (22:02 -0700)]
Fix typo in src/doc/manifest.md

11 years agoauto merge of #710 : alexcrichton/cargo/metadata, r=wycats
bors [Wed, 22 Oct 2014 19:45:38 +0000 (19:45 +0000)]
auto merge of #710 : alexcrichton/cargo/metadata, r=wycats

In terms of future compatibility, Cargo may wish to add more information to
lockfiles in the future. For example, the minimum required Rust version may one
day be encoded into a lockfile.

One of the major goals of a lockfile is for it to rarely change, and when it
does change the diffs should be minimal. In terms of adding more information to
the lockfile in the future, this presents a problem for older Cargo clients:

1. Cargo 2.0 adds a minimum required version of rust under the metadata.rustc
   key of the lockfile.
2. Cargo 1.0 is then used to update the `foo` dependency in the lockfile. When
   regenerating the lockfile, Cargo 1.0 discards the metadata inserted by Cargo
   2.0.

In order to future-proof ourselves in allowing new metadata in the future, Cargo
is growing support now for transporting an opaque payload of metadata from one
version of a lockfile to a new versions. This should solve the problem presented
above.

This metadata section is designed to be safely ignored by older Cargo versions
(may just have some surprising behavior), while still allowing newer versions of
Cargo to process the data. For example Cargo 2.0 would gracefully fail on an
out-of-date rustc, while Cargo 1.0 may just present an obscure error message.

r? @wycats

11 years agoAdd a metadata section to the lockfile
Alex Crichton [Wed, 15 Oct 2014 23:18:43 +0000 (16:18 -0700)]
Add a metadata section to the lockfile

In terms of future compatibility, Cargo may wish to add more information to
lockfiles in the future. For example, the minimum required Rust version may one
day be encoded into a lockfile.

One of the major goals of a lockfile is for it to rarely change, and when it
does change the diffs should be minimal. In terms of adding more information to
the lockfile in the future, this presents a problem for older Cargo clients:

1. Cargo 2.0 adds a minimum required version of rust under the metadata.rustc
   key of the lockfile.
2. Cargo 1.0 is then used to update the `foo` dependency in the lockfile. When
   regenerating the lockfile, Cargo 1.0 discards the metadata inserted by Cargo
   2.0.

In order to future-proof ourselves in allowing new metadata in the future, Cargo
is growing support now for transporting an opaque payload of metadata from one
version of a lockfile to a new versions. This should solve the problem presented
above.

This metadata section is designed to be safely ignored by older Cargo versions
(may just have some surprising behavior), while still allowing newer versions of
Cargo to process the data. For example Cargo 2.0 would gracefully fail on an
out-of-date rustc, while Cargo 1.0 may just present an obscure error message.

11 years agoauto merge of #737 : gentoo90/cargo/bash-comp, r=alexcrichton
bors [Wed, 22 Oct 2014 19:31:05 +0000 (19:31 +0000)]
auto merge of #737 : gentoo90/cargo/bash-comp, r=alexcrichton

Requested in #531

11 years agoauto merge of #717 : alexcrichton/cargo/souped-up-resolve, r=wycats
bors [Wed, 22 Oct 2014 19:14:21 +0000 (19:14 +0000)]
auto merge of #717 : alexcrichton/cargo/souped-up-resolve, r=wycats

This series of commits is rebased on top of https://github.com/rust-lang/cargo/pull/712 to avoid conflicts, and it adds the ability to solve version constraints as part of the resolution process. This is a critical step forward in bringing the registry online as it makes it possible for cargo to figure out what to do in the face of many uploaded versions of a package to the registry.

r? @wycats

11 years agoMake to_url public for rustc
Alex Crichton [Wed, 22 Oct 2014 19:12:06 +0000 (12:12 -0700)]
Make to_url public for rustc

11 years agoAvoid visiting deps too often in resolve
Alex Crichton [Fri, 17 Oct 2014 19:23:10 +0000 (12:23 -0700)]
Avoid visiting deps too often in resolve

If we're activating an already-active version of a dependency, then there's no
need to actually recurse into it. Instead, we can skip it if we're not enabling
any extra features in it to avoid extraneous recursion.

11 years agosource changes
Alex Crichton [Fri, 17 Oct 2014 19:22:52 +0000 (12:22 -0700)]
source changes

11 years agoContinue reducing clone costs
Alex Crichton [Fri, 17 Oct 2014 18:50:18 +0000 (11:50 -0700)]
Continue reducing clone costs

Share the `visited` hash set among all contexts, just be sure to maintain it
across failures. Also put all Summary structures into an `Rc` as they're cloned
quite frequently.

11 years agoMake SourceId cheap to clone
Alex Crichton [Fri, 17 Oct 2014 18:48:57 +0000 (11:48 -0700)]
Make SourceId cheap to clone

Like PackageId, these are cloned quite often, so this moves them into an Arc to
make them cheap to clone. This also removes the public fields in favor of
accessors.

11 years agoMake PackageId cheap to clone
Alex Crichton [Fri, 17 Oct 2014 18:47:33 +0000 (11:47 -0700)]
Make PackageId cheap to clone

These are cloned a massive number of times during resolution, so let's make them
much cheaper to clone with an Arc. This uses Arc instead of Rc because the
fiddly bits in job_queue have a PackageId cross task boundaries for parallelism.

11 years agoImplement resolution of version requirements
Alex Crichton [Fri, 17 Oct 2014 15:17:17 +0000 (08:17 -0700)]
Implement resolution of version requirements

This commit extends the support in cargo's resolver to start resolving packages
with multiple versions as well as package requirements. This is a crucial step
forward when impelmenting the cargo registry as multiple versions will be
uploaded to the registry quite quickly!

This implements a fairly naive solution which should at least help cargo get out
the gates initially. This impelments a depth-first-search of the pacakage
dependency graph with a few sorting heuristics along the way to help out
resolution as it goes along.

Resolution errors will likely improve over time, but this commit does make an
effort to try to get some good error messages right off the bat.

11 years agoSplit out encoding from `core::resolver` to a submodule
Alex Crichton [Thu, 16 Oct 2014 18:25:05 +0000 (11:25 -0700)]
Split out encoding from `core::resolver` to a submodule

Same exported hierarchy, just some internal orgainzational changes.

11 years agoUpdate semver to have `^` be the default operator
Alex Crichton [Thu, 16 Oct 2014 18:19:28 +0000 (11:19 -0700)]
Update semver to have `^` be the default operator

11 years agoCreate bash_completion.d directory
gentoo90 [Wed, 22 Oct 2014 09:07:40 +0000 (12:07 +0300)]
Create bash_completion.d directory

11 years agoAdd bashcomp to Makefile.in
gentoo90 [Tue, 21 Oct 2014 17:32:20 +0000 (20:32 +0300)]
Add bashcomp to Makefile.in

11 years agoBash completion initial support
gentoo90 [Tue, 21 Oct 2014 17:30:06 +0000 (20:30 +0300)]
Bash completion initial support

11 years agoauto merge of #732 : alexcrichton/cargo/update, r=alexcrichton
bors [Tue, 21 Oct 2014 16:04:11 +0000 (16:04 +0000)]
auto merge of #732 : alexcrichton/cargo/update, r=alexcrichton

Also merge some other PRs while I'm at it

11 years agoUpdate dependencies to unbreak the build
Alex Crichton [Tue, 21 Oct 2014 15:35:05 +0000 (08:35 -0700)]
Update dependencies to unbreak the build

11 years agoMerge remote-tracking branch 'tomaka/add-docs' into update
Alex Crichton [Tue, 21 Oct 2014 15:35:00 +0000 (08:35 -0700)]
Merge remote-tracking branch 'tomaka/add-docs' into update

11 years agoMerge commit 'jdeseno/remove-deprecated' into update
Alex Crichton [Tue, 21 Oct 2014 15:34:23 +0000 (08:34 -0700)]
Merge commit 'jdeseno/remove-deprecated' into update

11 years agoAdd general doccomments
Pierre Krieger [Tue, 21 Oct 2014 14:38:29 +0000 (16:38 +0200)]
Add general doccomments

11 years agoReplace usage of `get_ref`
Joshua DeSeno [Tue, 21 Oct 2014 07:49:11 +0000 (16:49 +0900)]
Replace usage of `get_ref`

11 years agoauto merge of #722 : blaenk/cargo/rpath-docs, r=alexcrichton
bors [Mon, 20 Oct 2014 05:14:53 +0000 (05:14 +0000)]
auto merge of #722 : blaenk/cargo/rpath-docs, r=alexcrichton

The `rpath` option was added (awesome!) but not documented.

11 years agouse rpath defaults
Jorge Israel Peña [Mon, 20 Oct 2014 03:36:19 +0000 (20:36 -0700)]
use rpath defaults

11 years agodocument rpath option in manifest
Jorge Israel Peña [Sun, 19 Oct 2014 21:33:29 +0000 (14:33 -0700)]
document rpath option in manifest

11 years agoauto merge of #721 : EduardoBautista/cargo/update-docs-url, r=alexcrichton
bors [Sat, 18 Oct 2014 15:29:55 +0000 (15:29 +0000)]
auto merge of #721 : EduardoBautista/cargo/update-docs-url, r=alexcrichton

11 years agoUpdate docs url
Eduardo Bautista [Sat, 18 Oct 2014 06:17:02 +0000 (01:17 -0500)]
Update docs url

11 years agoauto merge of #720 : alexcrichton/cargo/no-more-plugins, r=brson
bors [Fri, 17 Oct 2014 23:03:03 +0000 (23:03 +0000)]
auto merge of #720 : alexcrichton/cargo/no-more-plugins, r=brson

It's looking more likely like plugins will not make it into the stable channel
of Rust, so this commits removes Cargo's personal dependence on the two
plugin-based pieces of functionality it was using:

1. Uses of the `regex!` macro now go through `Regex::new`.
2. Uses of the `docopt!` macro now go through `deriving(Decodable)` instead.

11 years agoauto merge of #711 : alexcrichton/cargo/issue-708, r=brson
bors [Fri, 17 Oct 2014 22:48:18 +0000 (22:48 +0000)]
auto merge of #711 : alexcrichton/cargo/issue-708, r=brson

I can't quite remember why this ifdef is present to silently run `make` as a
normal user, and it doesn't seem to work if `make install` is run while as root,
so I'm just removing it and requiring that `make` is run before `make install`
unconditionally.

Closes #708

11 years agoRemove dependence on various plugins
Alex Crichton [Fri, 17 Oct 2014 22:04:13 +0000 (15:04 -0700)]
Remove dependence on various plugins

It's looking more likely like plugins will not make it into the stable channel
of Rust, so this commits removes Cargo's personal dependence on the two
plugin-based pieces of functionality it was using:

1. Uses of the `regex!` macro now go through `Regex::new`.
2. Uses of the `docopt!` macro now go through `deriving(Decodable)` instead.

11 years agoauto merge of #712 : alexcrichton/cargo/issue-633, r=brson
bors [Fri, 17 Oct 2014 22:22:39 +0000 (22:22 +0000)]
auto merge of #712 : alexcrichton/cargo/issue-633, r=brson

As pointed in #633, it's currently not possible for a package to reexport the
feature of another package due to the limitations of how features are defined.

This commit adds support for this ability by allowing features of the form
`foo/bar` in the `features` section of the manifest. This form indicates that
the dependency `foo` should have its `bar` feature enabled. Additionally, it is
not required that `foo` is an optional dependency.

This does not allow features of the form `foo/bar` in a `[dependencies]`
features section as dependencies shouldn't be enabling features for other
dependencies.

At the same time, this passes through features to build commands to solve a few more issues.

Closes #97
Closes #601 (this is an equivalent solution for that problem)
Closes #633
Closes #674

11 years agoauto merge of #719 : alexcrichton/cargo/update-docopt, r=alexcrichton
bors [Fri, 17 Oct 2014 22:09:50 +0000 (22:09 +0000)]
auto merge of #719 : alexcrichton/cargo/update-docopt, r=alexcrichton

11 years agoUpdate to rust master to remove libdebug
Alex Crichton [Fri, 17 Oct 2014 22:05:54 +0000 (15:05 -0700)]
Update to rust master to remove libdebug

11 years agoIgnore EPERM when scanning for packages
Alex Crichton [Fri, 17 Oct 2014 21:02:16 +0000 (14:02 -0700)]
Ignore EPERM when scanning for packages

We won't make much progress reporting the error back up the chain, so we may as
well carry on!

11 years agoPass features to native build commands
Alex Crichton [Thu, 16 Oct 2014 17:33:35 +0000 (10:33 -0700)]
Pass features to native build commands

Closes #97
Closes #601 (this is an equivalent solution for that problem)

11 years agoAllow reexporting of features between packages
Alex Crichton [Thu, 16 Oct 2014 17:09:39 +0000 (10:09 -0700)]
Allow reexporting of features between packages

As pointed in #633, it's currently not possible for a package to reexport the
feature of another package due to the limitations of how features are defined.

This commit adds support for this ability by allowing features of the form
`foo/bar` in the `features` section of the manifest. This form indicates that
the dependency `foo` should have its `bar` feature enabled. Additionally, it is
not required that `foo` is an optional dependency.

This does not allow features of the form `foo/bar` in a `[dependencies]`
features section as dependencies shouldn't be enabling features for other
dependencies.

Closes #633
Closes #674

11 years agoRequire `make` is run before `make install`
Alex Crichton [Thu, 16 Oct 2014 15:36:57 +0000 (08:36 -0700)]
Require `make` is run before `make install`

I can't quite remember why this ifdef is present to silently run `make` as a
normal user, and it doesn't seem to work if `make install` is run while as root,
so I'm just removing it and requiring that `make` is run before `make install`
unconditionally.

Closes #708

11 years agoauto merge of #709 : alexcrichton/cargo/issue-705, r=brson
bors [Wed, 15 Oct 2014 20:14:53 +0000 (20:14 +0000)]
auto merge of #709 : alexcrichton/cargo/issue-705, r=brson

This will enable passing `-C rpath` on all compiles to rustc itself.

Closes #705

11 years agoAdd an `rpath` option to the profile section
Alex Crichton [Wed, 15 Oct 2014 17:28:15 +0000 (10:28 -0700)]
Add an `rpath` option to the profile section

This will enable passing `-C rpath` on all compiles to rustc itself.

Closes #705

11 years agoauto merge of #700 : alexcrichton/cargo/issue-697, r=brson
bors [Tue, 14 Oct 2014 23:44:54 +0000 (23:44 +0000)]
auto merge of #700 : alexcrichton/cargo/issue-697, r=brson

When a source has multiple crates inside of it, `cargo update -p foo` would
previously not actually update anything because the extra crates were continuing
to lock the source to the same revision. This change updates the "avoid me"
logic to avoid *sources*, not *packages*.

Closes #697

11 years agoauto merge of #699 : alexcrichton/cargo/issue-695, r=brson
bors [Tue, 14 Oct 2014 22:59:55 +0000 (22:59 +0000)]
auto merge of #699 : alexcrichton/cargo/issue-695, r=brson

Closes #695

11 years agoauto merge of #706 : kballard/cargo/patch-1, r=alexcrichton
bors [Tue, 14 Oct 2014 21:44:58 +0000 (21:44 +0000)]
auto merge of #706 : kballard/cargo/patch-1, r=alexcrichton

`$(OUT_DIR)` may contain spaces, so it needs to be quoted. It also needs to be expanded by the shell, not by `make`, or any quotes/backslashes in the value will cause problems.

11 years agoTweak native-build.md example
Kevin Ballard [Tue, 14 Oct 2014 21:30:17 +0000 (14:30 -0700)]
Tweak native-build.md example

`$(OUT_DIR)` may contain spaces, so it needs to be quoted. It also needs to be expanded by the shell, not by `make`, or any quotes/backslashes in the value will cause problems.

11 years agoauto merge of #698 : eagleflo/cargo/new-invalid-characters, r=alexcrichton
bors [Tue, 14 Oct 2014 19:59:57 +0000 (19:59 +0000)]
auto merge of #698 : eagleflo/cargo/new-invalid-characters, r=alexcrichton

Crate names have tight restrictions in Rust. `cargo new` should not allow invalid characters in crate names, as such crates will just fail to compile later on.

This check is based on the one found in rustc's `validate_crate_name` (https://github.com/rust-lang/rust/blob/master/src/librustc/metadata/creader.rs#L185-L189).

11 years agoauto merge of #703 : alexcrichton/cargo/doc.crates.io, r=alexcrichton
bors [Mon, 13 Oct 2014 23:45:00 +0000 (23:45 +0000)]
auto merge of #703 : alexcrichton/cargo/doc.crates.io, r=alexcrichton

The actual crates.io domain will become the registry itself, but the
auto-generated documentation from this repository will continue to be available
at the doc.crates.io domain.

In the meantime, we've set up redirects from crates.io and www.crates.io to
doc.crates.io and the github-pages site will now be doc.crates.io

11 years agoCheck crate name for invalid characters in cargo new
Aku Kotkavuo [Mon, 13 Oct 2014 00:05:41 +0000 (03:05 +0300)]
Check crate name for invalid characters in cargo new

11 years agoMove documentation to doc.crates.io
Alex Crichton [Mon, 13 Oct 2014 23:31:33 +0000 (16:31 -0700)]
Move documentation to doc.crates.io

The actual crates.io domain will become the registry itself, but the
auto-generated documentation from this repository will continue to be available
at the doc.crates.io domain.

In the meantime, we've set up redirects from crates.io and www.crates.io to
doc.crates.io and the github-pages site will now be doc.crates.io

11 years agoauto merge of #701 : kagia/cargo/master, r=alexcrichton
bors [Mon, 13 Oct 2014 22:47:06 +0000 (22:47 +0000)]
auto merge of #701 : kagia/cargo/master, r=alexcrichton

links added and grouped to encourage matching versions to be downloaded...

11 years agoauto merge of #696 : bkoropoff/cargo/build-break, r=alexcrichton
bors [Mon, 13 Oct 2014 22:15:02 +0000 (22:15 +0000)]
auto merge of #696 : bkoropoff/cargo/build-break, r=alexcrichton

11 years agolink to 64bit windows binaries #639
Benjamin Kagia [Mon, 13 Oct 2014 21:02:30 +0000 (00:02 +0300)]
link to 64bit windows binaries #639

links added and grouped to encourage matching versions to be downloaded...

11 years agoFix updating sources with more than one crate
Alex Crichton [Mon, 13 Oct 2014 16:54:08 +0000 (09:54 -0700)]
Fix updating sources with more than one crate

When a source has multiple crates inside of it, `cargo update -p foo` would
previously not actually update anything because the extra crates were continuing
to lock the source to the same revision. This change updates the "avoid me"
logic to avoid *sources*, not *packages*.

Closes #697

11 years agoDon't hardcode i32 in FFI bindings
Alex Crichton [Mon, 13 Oct 2014 16:44:58 +0000 (09:44 -0700)]
Don't hardcode i32 in FFI bindings

11 years agoUpgrade docopt/docopt_macros to fix build break
Brian Koropoff [Sun, 12 Oct 2014 23:50:06 +0000 (16:50 -0700)]
Upgrade docopt/docopt_macros to fix build break

11 years agoOnly one CNAME is allowed!
Alex Crichton [Sat, 11 Oct 2014 05:03:11 +0000 (22:03 -0700)]
Only one CNAME is allowed!

11 years agoUpdate travis token to upload docs
Alex Crichton [Sat, 11 Oct 2014 04:41:59 +0000 (21:41 -0700)]
Update travis token to upload docs

11 years agoAdd doc.crates.io to src/doc/CNAME
Alex Crichton [Sat, 11 Oct 2014 04:31:54 +0000 (21:31 -0700)]
Add doc.crates.io to src/doc/CNAME

The actual crates.io domain will likely be superseded by the registry, and this
gh-pages site will be relegated to the documentation.

11 years agoauto merge of #689 : alexcrichton/cargo/update, r=alexcrichton
bors [Fri, 10 Oct 2014 15:05:22 +0000 (15:05 +0000)]
auto merge of #689 : alexcrichton/cargo/update, r=alexcrichton

11 years agoUpdate to rust master
Alex Crichton [Fri, 10 Oct 2014 15:03:45 +0000 (08:03 -0700)]
Update to rust master

11 years agoauto merge of #682 : vhbit/cargo/empty-features, r=alexcrichton
bors [Thu, 9 Oct 2014 19:44:57 +0000 (19:44 +0000)]
auto merge of #682 : vhbit/cargo/empty-features, r=alexcrichton

For automation it should be no difference between invocations
of `--features "feat1 feat2 feat3"` and `--features ""`.

The problem is that in the latter case `docopt` sets flag_feature to vec![""]

Could be solved on 3 different levels:

- patching `docopt` to treat empty string for a Vec<String> flag
  as empty vec. Although I can't imagine that in some place it
  might be required to treat empty string as vector of empty
  strings it is might have its own use

- filtering flags_feature right after parsing command line and
  before passing further. It means it should be fixed in at
  least 4 different places now and may be forgotten in future

- filtering empty string feature while resolving - perhaps
  the easiest and more universal solution, implemented in this
  patch

11 years agoAllow to invoke Cargo commands with empty features
Valerii Hiora [Wed, 8 Oct 2014 05:54:16 +0000 (08:54 +0300)]
Allow to invoke Cargo commands with empty features

For automation it should be no difference between invocations
of `--features "feat1 feat2 feat3"` and `--features ""`.

The problem is that in the latter case `docopt` sets flag_feature to vec![""]

Could be solved on 3 different levels:

- patching `docopt` to treat empty string for a Vec<String> flag
  as empty vec. Although I can't imagine that in some place it
  might be required to treat empty string as vector of empty
  strings it is might have its own use.

- filtering flags_feature right after parsing command line and
  before passing further. It means it should be fixed in at
  least 4 different places now and may be forgotten in future.

- filtering empty string feature while resolving - perhaps
  the easiest and more universal solution, implemented in this
  patch.

11 years agoauto merge of #688 : alexcrichton/cargo/update, r=alexcrichton
bors [Thu, 9 Oct 2014 17:02:17 +0000 (17:02 +0000)]
auto merge of #688 : alexcrichton/cargo/update, r=alexcrichton

11 years agoUpdate dependencies and update to rust master
Alex Crichton [Thu, 9 Oct 2014 15:17:41 +0000 (08:17 -0700)]
Update dependencies and update to rust master

11 years agoauto merge of #677 : sfackler/cargo/rustdoc-features, r=alexcrichton
bors [Tue, 7 Oct 2014 23:29:57 +0000 (23:29 +0000)]
auto merge of #677 : sfackler/cargo/rustdoc-features, r=alexcrichton

Note that they won't actually work until rust-lang/rust#17834 lands.

11 years agoauto merge of #679 : alexcrichton/cargo/fix-doc-test, r=brson
bors [Tue, 7 Oct 2014 20:29:59 +0000 (20:29 +0000)]
auto merge of #679 : alexcrichton/cargo/fix-doc-test, r=brson

11 years agoUse the right package for doc test variables
Alex Crichton [Tue, 7 Oct 2014 19:01:10 +0000 (12:01 -0700)]
Use the right package for doc test variables

11 years agoauto merge of #676 : jdeseno/cargo/warnings, r=alexcrichton
bors [Tue, 7 Oct 2014 18:59:59 +0000 (18:59 +0000)]
auto merge of #676 : jdeseno/cargo/warnings, r=alexcrichton

11 years agoPass features along to rustdoc
Steven Fackler [Tue, 7 Oct 2014 04:04:29 +0000 (21:04 -0700)]
Pass features along to rustdoc

11 years agoauto merge of #671 : alexcrichton/cargo/issue-668, r=brson
bors [Tue, 7 Oct 2014 03:07:37 +0000 (03:07 +0000)]
auto merge of #671 : alexcrichton/cargo/issue-668, r=brson

Examples are classified as binaries, but do not have the `test` flag set on
their Profile. They do, however, have their environment set to `test`. Be sure
to place them into the `tests` bucket so they have development dependencies
available for their compilation.

Closes #668

11 years agoMake sure dev-deps are compiled for examples
Alex Crichton [Mon, 6 Oct 2014 03:00:42 +0000 (20:00 -0700)]
Make sure dev-deps are compiled for examples

Examples are classified as binaries, but do not have the `test` flag set on
their Profile. They do, however, have their environment set to `test`. Be sure
to place them into the `tests` bucket so they have development dependencies
available for their compilation.

11 years agoauto merge of #673 : alexcrichton/cargo/issue-665, r=brson
bors [Tue, 7 Oct 2014 01:15:02 +0000 (01:15 +0000)]
auto merge of #673 : alexcrichton/cargo/issue-665, r=brson

Otherwise the order was nondeterministic likely due to some hash map along the
way being used to deduplicate the set of features.

Closes #665

11 years agoFix warnings for constant names
Joshua DeSeno [Tue, 7 Oct 2014 00:25:05 +0000 (09:25 +0900)]
Fix warnings for constant names

11 years agoauto merge of #661 : alexcrichton/cargo/issue-660, r=brson
bors [Mon, 6 Oct 2014 23:45:06 +0000 (23:45 +0000)]
auto merge of #661 : alexcrichton/cargo/issue-660, r=brson

When using `cargo test -p`, be sure to run only the doc tests for the package
actually being tested.

Closes #660

11 years agoDon't always run doc tests for the root package
Alex Crichton [Fri, 3 Oct 2014 01:57:33 +0000 (18:57 -0700)]
Don't always run doc tests for the root package

When using `cargo test -p`, be sure to run only the doc tests for the package
actually being tested.

Closes #660

11 years agoauto merge of #663 : alexcrichton/cargo/issue-648, r=brson
bors [Mon, 6 Oct 2014 23:00:04 +0000 (23:00 +0000)]
auto merge of #663 : alexcrichton/cargo/issue-648, r=brson

This means that if a project has a file with a space in the name it will
properly have its freshness calculated as opposed to always having it as a
candidate to be rebuilt.

Closes #648

11 years agoauto merge of #675 : alexcrichton/cargo/fix-selective-test, r=brson
bors [Mon, 6 Oct 2014 20:30:07 +0000 (20:30 +0000)]
auto merge of #675 : alexcrichton/cargo/fix-selective-test, r=brson

Now that we have selective testing, this no longer makes any sense and all
queries to the path layout need to be based on the package being queried for.
This removes the primary flag from the Context, and requires that the `layout`
method have a local Package available

cc servo/servo#3580

11 years agoRemove the notion of "primary" from Context
Alex Crichton [Mon, 6 Oct 2014 18:27:16 +0000 (11:27 -0700)]
Remove the notion of "primary" from Context

Now that we have selective testing, this no longer makes any sense and all
queries to the path layout need to be based on the package being queried for.
This removes the primary flag from the Context, and requires that the `layout`
method have a local Package available

cc servo/servo#3580

11 years agoauto merge of #672 : bkoropoff/cargo/option-map-cleanup, r=alexcrichton
bors [Mon, 6 Oct 2014 14:15:07 +0000 (14:15 +0000)]
auto merge of #672 : bkoropoff/cargo/option-map-cleanup, r=alexcrichton

This reduces syntactic noise and is a good use case for `if let`, which I turned on.

11 years agoSort feature lists for fingerprint hashing
Alex Crichton [Mon, 6 Oct 2014 03:21:57 +0000 (20:21 -0700)]
Sort feature lists for fingerprint hashing

Otherwise the order was nondeterministic likely due to some hash map along the
way being used to deduplicate the set of features.

Closes #665

11 years agoClean up some uses of `Option::map` only for its side effects
Brian Koropoff [Sun, 5 Oct 2014 22:59:58 +0000 (15:59 -0700)]
Clean up some uses of `Option::map` only for its side effects

11 years agoauto merge of #667 : jakerr/cargo/help-help, r=alexcrichton
bors [Mon, 6 Oct 2014 03:15:06 +0000 (03:15 +0000)]
auto merge of #667 : jakerr/cargo/help-help, r=alexcrichton

This adds a dummy help command so that it's usage can be documented with docopt! This lets `cargo help help` work.

Also adds help flags to all of the subcommands that were missing them. Without
that `cargo help sub-command` shows Invalid Argument before the usage text.

11 years agoauto merge of #670 : bkoropoff/cargo/unused-everywhere, r=alexcrichton
bors [Mon, 6 Oct 2014 02:30:06 +0000 (02:30 +0000)]
auto merge of #670 : bkoropoff/cargo/unused-everywhere, r=alexcrichton

I'm not sure what changed, but unused value lints were popping up everwhere when I tried to build today.

This turns on the `if let` feature since it allows rewriting a lot of calls to `Option::map` that were only being used for their side effects into a clean form.  Cargo seems as good of a place as any to dogfood it.

11 years agoRemote `unused` lint
Brian Koropoff [Sun, 5 Oct 2014 23:06:50 +0000 (16:06 -0700)]
Remote `unused` lint

It's causing tons of not-very-helpful errors that are breaking the build.

11 years agoLet the help command work consistently everywhere
Jake Kerr [Sun, 5 Oct 2014 07:13:43 +0000 (16:13 +0900)]
Let the help command work consistently everywhere

This adds a dummy help command so that it's usage can be documented with docopt!

Also adds help flags to all of the subcommands that were missing them. Without
that `cargo help sub-command` shows Invalid Argument before the usage text.

11 years agoParse escaped spaces in makefile dependencies
Alex Crichton [Fri, 3 Oct 2014 01:37:27 +0000 (18:37 -0700)]
Parse escaped spaces in makefile dependencies

This means that if a project has a file with a space in the name it will
properly have its freshness calculated as opposed to always having it as a
candidate to be rebuilt.

Closes #648

11 years agoauto merge of #630 : alexcrichton/cargo/issue-432, r=brson
bors [Fri, 3 Oct 2014 01:57:14 +0000 (01:57 +0000)]
auto merge of #630 : alexcrichton/cargo/issue-432, r=brson

This is a series of commits which culminates in fixing #432, fixing a number of other related issues along the way. The biggest user-facing fix here is that if you run `cargo build` followed by `cargo test` your library will no longer be rebuilt if you have dev-dependencies.

11 years agoAdd a test for #432
Alex Crichton [Wed, 24 Sep 2014 05:14:02 +0000 (22:14 -0700)]
Add a test for #432

All problems have been fixed in the previous commits, and this now closes #432